<ion-view view-title="{{language == 0?'四方当代美术馆':'Sifang Art Museum'}}">
  <ion-content class="normal_box bg" delegate-handle="mainScroll" overflow-scroll="false">
    <div class="top_header">
      <span class="header_left" ng-click="backhome()">
        <!-- <img src="img/backhome.png" class="backhome" /> -->
        <img src="img/backhome.png" class="backhome" />
      </span>
      <i class="iconfont icon-Path5 top_icon2" ng-click="gotoCenter()"></i>
      <!-- <i class="iconfont icon-Path11 top_icon3" ng-click="gotoShop()"></i> -->
    </div>
    
    <div class="banner_box">
      <!-- <img src="img/sanjiao.png" class="sanjiao" /> -->
      <img ng-src="{{fullPath(detail.banner_path)}}" class="detail_banner" />
    </div>

    <div class="normal_box pd0_20 mt15">
      <p class="ticket_span1">{{language == 0?'类型':'Ticket Type'}}</p>

      <div class="normal_box mt15">
        <div class="w50 ticket_type1" ng-repeat="(key,list) in tickets">
          <span class="ticket_pre" ng-click="choose_ticket(key,list)" ng-class="{'ticket_chosen':list.is_chosen == 1,'fl':(key+1)%2==1,'fr':(key+1)%2==0,'f10_i':language==1}">{{language == 0?list.name:list.name_en}}</span>
        </div>
      </div>

      <div class="ticket_span1 pr85 pos_re">
        {{language == 0?'数量':'Quantity'}}
        <div class="num_box">
          <span class="ticket_minuse" ng-click="delete()" ng-hide="ticket.price==0" ng-class="{'ticket_btn_disabled':ticket.price==0}">-</span>
          <input class="ticket_num1" ng-model="order.num" max="{{buylimit}}" ng-if="ticket.price>0" min="1" ng-change="check_morethan()"/>
          <input class="ticket_num1" ng-model="order.num" readonly min="1" max="1" ng-if="ticket.price==0"/>
          <span class="ticket_plus" ng-click="add()" ng-hide="ticket.price==0" ng-class="{'ticket_btn_disabled':ticket.price==0}">+</span>
        </div>
        <span class="redf morethan" ng-if="morethan == 1">* 购买量不可超过 {{buylimit}}</span>
      </div>
      
      <div class="normal_box ticket_box2">
        
        <p class="ticket_box2_line pr110 pos_re">
          <span class="fl ticket_left_span" ng-class="{'f18_i':language == 1}">{{language == 0?detail.name:detail.name_en}}</span>
          <span class="fr ticket_right_span pos_ab r0t0">
            <em ng-show="!detail.user||!detail.user.vip&&ticket.price!=0"><i class="f16">￥</i>{{ticket.price}}</em>
            <em ng-show="detail.user&&detail.user.vip&&ticket.price_activity!=0"><i class="f16">￥</i>{{ticket.price_activity}}</em>
            <em ng-show="ticket.price==0">{{language == 0?"免费":"Free"}}</em>
            <br>
            <span class="fr ticket_right_span2" ng-class="{'pfsc':language == 1}">{{language == 0?ticket.name:ticket.name_en}}</span>
          </span>
        </p>

        <!-- <p class="ticket_box2_line2 pr110 pos_re"><span class="fl ticket_left_span2">{{language == 0?detail.name_en:detail.name}}</span><span class="fr ticket_right_span2 pos_ab r0t0" ng-class="{'pfsc':language == 1}">{{language == 0?ticket.name:ticket.name_en}}</span></p> -->

        <div class="ticket_text" ng-if="language == 0" ng-bind-html="ticket.introduction|nl2br"></div>
        <div class="ticket_text" ng-if="language == 1" ng-bind-html="ticket.introduction_en|nl2br"></div>
        
        <div class="w100 pd0_2">
          <!-- 正常 -->
          <!-- 非会员 -->
          <div ng-if="!detail.user||!detail.user.vip">
            <button class="ticket_buy" ng-disabled="order.num == 0||morethan == 1" ng-if="language == 0&&ticket.price!=0&&ticket.price>0&&(detail.limit==0||(detail.limit>0&&detail.paid<detail.limit))" ng-click="payOrder()">支付<span class="ticket_money">共￥<span>{{order.num*ticket.price}}</span></span></button>
            <button class="ticket_buy" ng-disabled="order.num == 0||morethan == 1" ng-if="language == 1&&ticket.price!=0&&ticket.price>0&&(detail.limit==0||(detail.limit>0&&detail.paid<detail.limit))" ng-click="payOrder()">Pay <span class="ticket_money">￥<span>{{order.num*ticket.price}} in total</span></span></button>
          </div>
          <!-- 会员 -->
          <div ng-if="detail.user&&detail.user.vip">
            <button class="ticket_buy" ng-disabled="order.num == 0||morethan == 1" ng-if="language == 0&&ticket.price!=0&&(detail.limit==0||(detail.limit>0&&detail.paid<detail.limit))" ng-click="payOrder()">支付<span class="ticket_money">共￥<span>{{order.num*ticket.price_activity}}</span></span></button>
            <button class="ticket_buy" ng-disabled="order.num == 0||morethan == 1" ng-if="language == 1&&ticket.price!=0&&(detail.limit==0||(detail.limit>0&&detail.paid<detail.limit))" ng-click="payOrder()">Pay <span class="ticket_money">￥<span>{{order.num*ticket.price_activity}} in total</span></span></button>
          </div>
          
          <!-- 免费情况 -->
          <button class="ticket_buy" ng-disabled="order.num == 0" ng-if="language==0&&ticket.price==0&&(detail.limit==0||(detail.limit>0&&detail.paid<detail.limit))" ng-click="panduan()">立即预约</span></button>
          <button class="ticket_buy" ng-disabled="order.num == 0" ng-if="language == 1&&ticket.price==0&&(detail.limit==0||(detail.limit>0&&detail.paid<detail.limit))" ng-click="panduan()">Book Now</span></button>
          <!-- 活动名额已满 -->
          <button class="ticket_buy" ng-disabled="order.num == 0" ng-if="language == 0&&detail.limit>0&&detail.paid>=detail.limit" ng-disabled></span>名额已满</button>
          <button class="ticket_buy" ng-disabled="order.num == 0" ng-if="language == 1&&detail.limit>0&&detail.paid>=detail.limit" ng-disabled>Oversubscribed</span></button>
        </div>

      </div>
    </div>

    <!-- <p class="ticket_detail" ng-click="showDetail()" id="textdetail">{{language == 0?'详情介绍':'Details Introduction'}}<i class="iconfont icon-up" ng-if="show == 1"></i><i class="iconfont icon-down" ng-if="show == 0"></i></p> -->

    <div class="normal_box detail_text" ng-bind-html="language == 0?detail.description:detail.description_en|trustHtml">
      <!-- <img ng-src="{{fullPath(detail.banner_path)}}" class="mw100" /> -->
    </div>
    <span style="opacity:0;" class="starttime">{{detail.begin_date*1000|date:'yyyy.MM.dd'}}</span>
    <span style="opacity:0;" class="endtime">{{detail.end_date*1000|date:'yyyy.MM.dd'}}</span>

    <div class="home_footer_art">
      <span class="home_footer9" ng-click="change_language(0)" ng-class="{'language_chosen':language == 0}">中文</span>
      <span class="home_footer8">|</span>
      <span class="home_footer7" ng-click="change_language(1)" ng-class="{'language_chosen':language == 1}">EN</span>
    </div>

  </ion-content>

  <div class="mubu_white pd165_22_0" ng-if="guide == '1'">
    <div class="pay_guide">

      <div class="guide_input">
        <span class="guide_cancle" ng-click="cancel_mbwhite()">关闭</span>
        <input type="text" placeholder="请填写您期望的参观时间" ng-model="pay_order.remark" style="height: 34px;"/>
        <button class="guide_btn" ng-class="{'color_9B':!pay_order.remark}" ng-disabled="!pay_order.remark" ng-click="pay()">确认，去支付</button>
      </div>
    </div>
  </div>

  <div class="window" id="windowcenter" style="display: block;" ng-if="order_mark == 1">
    <div id="title" class="title">{{language == 0?'提示':'Hint'}}</div>
    <div class="content">
     <div id="txt">{{language == 0?'是否确认预约' + detail.name + ticket.name + '?':'Are you sure to delete the address?'}}</div>
     <input type="button" value="{{language == 0?'确认':'Yes'}}" name="确认" class="txtbtn w50 fl" ng-click="sureorder()">
     <input type="button" value="{{language == 0?'取消':'No'}}" name="取消" class="txtbtn w50 fl" ng-click="cancelorder()"> 
    </div>
  </div>

  <div class="window" id="windowcenter" style="display: block;" ng-if="vip_mark == 1">
    <div id="title" class="title">{{language == 0?'提示':'Hint'}}</div>
    <div class="content">
     <div id="txt">{{language == 0?'仅限VIP会员预约':'VIP members only'}}</div>
     <input type="button" value="{{language == 0?'确认':'Yes'}}" name="确认" class="txtbtn w100 fl" ng-click="sureorder1()">
    </div>
  </div>

</ion-view>